<template>
  <div>
       <Slot class="slot_list">
            <div @click="onClickReturn"><van-icon name="arrow-left" /></div>
            <div>专栏详情</div>
            <div></div>
      </Slot>
      <div style="margin-top:50px">
          <div v-html="this.data.title" class="slot_title"></div>
          <div v-html="this.data.content" style="font-size:16px"></div>
      </div>
  </div>
</template>

<script>
import axios from "axios";
import Slot from "../components/slot/slot";
export default {
    data(){
        return{
            data:[],

        }
    },
    components:{
        Slot
    },
    mounted(){
        console.log(this.$route.query.id);
        let id = this.$route.query.id
        console.log(this.id);
        axios.get('https://api.it120.cc/small4/cms/news/detail',{
            params:{
                id:id
            }
        }).then(res=>{
            // console.log(res);
            this.data = res.data.data
            console.log(this.data);
        })
    },
    methods:{
        onClickReturn(){
            this.$router.go(-1)
        }
    }
}
</script>

<style>
.slot_list
{
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 16px;
  border-bottom: 1px solid black;
  position: fixed;
  top: 0;
  left: 0;
  background: white;
}
.slot_title
{
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
}
</style>